import { axios as request } from '@/utils/request'

export function getPropList(params) {
  return request({
    url: '/vue-admin-template/table/proplist',
    method: 'get',
    params
  })
}

// 查询全部
export function getAllList() {
  return request({
    url: `/form/table/all`,
    method: 'get'
  })
}

// 分页查询
export function getPageList(params) {
  return request({
    url: `/form/table/page`,
    method: 'get',
    params
  })
}

// 主键查询
export function getInfoById(id) {
  return request({
    url: `/form/table/get/${id}`,
    method: 'get'
  })
}

// 查询主表
export function getPrimaryList() {
  return request({
    url: `/form/table/queryPrimary`,
    method: 'get'
  })
}

// 根据父表Id查询子表
export function querySublist(parentId) {
  return request({
    url: `/form/table/querySublist/${parentId}`,
    method: 'get'
  })
}

// 新增数据
export function create(data) {
  return request({
    url: `/form/table/create`,
    method: 'post',
    data
  })
}

// 修改数据
export function update(data) {
  return request({
    url: `/form/table/update`,
    method: 'put',
    data
  })
}

// 逻辑删除
export function remove(ids) {
  return request({
    url: `/form/table/delete/${ids}`,
    method: 'delete'
  })
}
